﻿using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Write("对象访问：" + "<br/>");
        ClassField class1 = new ClassField();
        Response.Write(class1.add_x() + "<br/>");  //输出结果为1
        ClassField class2 = new ClassField();
        Response.Write(class2.add_x() + "<br/>");  //输出结果为1
        //静态的为类所共享。故每次的值都会改变       
        Response.Write("类访问：" + "<br/>");
        Response.Write(ClassField.add_y ()+ "<br/>");//输出结果为1
        Response.Write(ClassField.add_y() + "<br/>");//输出结果为2
    }
}
